package com.guchenbo.example.thread;

import cn.hutool.core.date.DateUtil;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class SleepDemo {
    ExecutorService executor = Executors.newFixedThreadPool(10);
    public static void main(String[] args) {

        Thread t1=GcbThreadFactory.create("t1",()->{
            for (int i = 0; i < 30; i++) {

                System.out.println(DateUtil.now());
            }
        });
        t1.start();
        System.out.println("time1");
        try {
            t1.sleep(3000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        System.out.println("time2");
    }
}
